package com.bolt.admin.module.sys.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.io.Serializable;

/**
 * @author 米超
 * 用户表头主键
 */
@Embeddable
public class UserTableHeadConfigPK implements Serializable {

	private static final long serialVersionUID = 1L;
    @Column(name = "USER_ID", length = 36)
	private String userId;
    @Column(name = "TABLE_ID", length = 36)

	private String tableId;
	
	public UserTableHeadConfigPK(){
		
	}
	public UserTableHeadConfigPK(String userId, String tableId){
		this.userId = userId;
		this.tableId = tableId;
	}
	

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getTableId() {
		return tableId;
	}

	public void setTableId(String tableId) {
		this.tableId = tableId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((userId == null) ? 0 : userId.hashCode());
		result = prime * result + ((tableId == null) ? 0 : tableId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UserTableHeadConfigPK other = (UserTableHeadConfigPK) obj;
		if (userId == null) {
			if (other.getUserId() != null)
				return false;
		} else if (!userId.equals(other.getUserId()))
			return false;
		if (tableId == null) {
			if (other.getTableId() != null)
				return false;
		} else if (!tableId.equals(other.getTableId()))
			return false;
		return true;
	}

}
